package top.lixunda.ecommerce.server.good.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.http.ResponseEntity;
import top.lixunda.ecommerce.server.good.api.entity.db.QiNiuFileDO;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 七牛云对象存储文件上传回调数据 服务类
 * </p>
 *
 * @author Xumda
 * @since 2020-01-19
 */
public interface IQiNiuFileService extends IService<QiNiuFileDO> {

    /**
     * 根据id下载文件
     *
     * @param id      id
     * @param request HttpServletRequest
     * @return ResponseEntity
     */
    ResponseEntity<byte[]> downloadAsFileById(Integer id, HttpServletRequest request);

    /**
     * 根据id下载文件
     *
     * @param url     文件网络地址
     * @param request HttpServletRequest
     * @return ResponseEntity
     */
    ResponseEntity<byte[]> downloadAsFileByUrl(String url, HttpServletRequest request);
}
